package com.rc.saas.mini.service.order;

import com.rc.saas.mini.mapper.order.OrderCommentMapper;
import com.rc.saas.mini.model.order.OrderComment;
import com.rc.saas.mini.model.order.OrderCommentExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author wangzhengwei
 * @create 2021/12/23
 */
@Service
public class OrderCommentServiceImpl implements OrderCommentService {

    @Autowired
    private OrderCommentMapper orderCommentMapper;

    @Override
    public OrderCommentMapper getMapper() {
        return orderCommentMapper;
    }

    @Override
    public OrderComment selectOrderByOutOrderNum(String outOrderNum) {
        OrderCommentExample example = new OrderCommentExample();
        example.createCriteria().andOutOrderNumEqualTo(outOrderNum);
        return orderCommentMapper.selectByExample(example).stream().findFirst().orElseGet(() -> null);
    }


}
